import java.util.LinkedList;
import java.util.Queue;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 蒋健
 * Date: 2022-02-07
 * Time: 14:19
 */
public class TestDemo {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        TreeNode root = binaryTree.createTree();
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println(binaryTree.size1(root));
        System.out.println(binaryTree.getLeafNodeCount(root));
        System.out.println(binaryTree.getKLevelNodeCount(root, 3));
        System.out.println(binaryTree.getHeight(root));
        System.out.println("========查找节点===========");
        try {
            TreeNode ret = binaryTree.find(root,'E');
            System.out.println(ret.val);
        }catch (NullPointerException e){
            e.printStackTrace();
            System.out.println("没有这个节点！");
        }
        System.out.println(binaryTree.isCompleteTree(root));

//        Queue<TreeNode> queue = new LinkedList<>();
//        queue.offer(null);
//        queue.offer(null);
//        queue.offer(null);
//        queue.offer(null);
//        System.out.println(queue.size());
    }
}
